use clap::{Arg, ArgAction, Command};

#[test]
fn test_required_if_eq_all() {
    let res = Command::new("prog")
        .arg(Arg::new("cfg")
            .action(ArgAction::Set)
            .required_if_eq("other", "special")
            .long("config"))
        .arg(Arg::new("other")
            .long("other")
            .action(ArgAction::Set))
        .try_get_matches_from(vec![
            "prog", "--other", "not-special",
        ]);

    assert!(res.is_ok());
}

#[test]
fn test_get_value_parser() {
    let cmd = clap::Command::new("raw")
        .arg(
            clap::Arg::new("port")
                .value_parser(clap::value_parser!(usize))
        );
    let value_parser = cmd.get_arguments()
        .find(|a| a.get_id() == "port").unwrap()
        .get_value_parser();
    println!("{value_parser:?}");
}